package com.mt.skyhoist.util.user;



import com.mt.skyhoist.util.Repository;
import com.mt.skyhoist.util.bean.DeviceModel;
import com.mt.skyhoist.util.bean.DeviceModelDao;

import java.util.List;

public class DeviceModelSource {
    private static DeviceModelSource INSTANCE;

    public static DeviceModelSource getInstance() {
        if (INSTANCE == null) {
            INSTANCE = new DeviceModelSource();
        }
        return INSTANCE;
    }

    private DeviceModelDao dao;

    private DeviceModelSource() {
        dao = Repository.getInstance().getDeviceModelDao();
    }

    public List<DeviceModel> getDeviceModel() {
        return dao.loadAll();
    }

    public void delete(DeviceModel deviceModel){
        dao.delete(deviceModel);
    }

    public void insert(DeviceModel deviceModel) {
        dao.insert(deviceModel);
    }

    public void update(DeviceModel deviceModel) {
        dao.update(deviceModel);
    }
}
